package com.niiwoo.civet.trade.dto.response.loan;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 *
 * @author lujing
 * @date 2018/4/20
 */
@Getter
@Setter
public class AgainstFakeModelV2CallbackRequestDTO extends AgainstFakeV2CallbackRequestDTO implements Serializable {
    private static final long serialVersionUID = -6029440529409193403L;
    private AntiFraudResult result;
    private Long flowExecuteId;
    private Integer decision;


    @Setter
    @Getter
    public static class AntiFraudResult implements Serializable {

        private static final long serialVersionUID = 3578451725735759373L;
        private Integer decision; // 反欺诈结果 0:accept 1:refuse 2:review

        private Detail detail; // 详情
    }

    @Setter
    @Getter
    public static class Detail implements Serializable {

        private static final long serialVersionUID = 8834833312210018061L;
        private List<GroupRule> group_rules; // 分群规则结果

        private List<BoolRule> bool_rules; // 命中的规则
    }

    @Setter
    @Getter
    public static class GroupRule implements Serializable {

        private static final long serialVersionUID = 8748178406358122452L;
        private String rule_id; // 规则ID

        private String rule_name; // 规则名称;

        private String group_index; // 命中的分组索引
    }

    @Setter
    @Getter
    public static class BoolRule implements Serializable {

        private static final long serialVersionUID = -2618149883747805464L;
        private String hit; // 命中情况 命中、未命中、异常

        private String rule_name; // 规则名称

        private String rule_id; // 规则ID

        private BigDecimal score; // 分数(非必填)

        private List<BoolRuleData> data; // 相关数据(非必填)

    }

    @Setter
    @Getter
    public static class BoolRuleData implements Serializable {

        private static final long serialVersionUID = -3498595955082236280L;
        private String hit; // 命中情况 命中、未命中、异常

        private String cellrule_name; // 子规则ID

        private String cellrule_id; // 子规则名称

        private String decison_code; // 决策代码

    }
}
